/**
 * Copyright &copy; 2012-2014 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.borrow.service;

import com.thinkgem.jeesite.common.persistence.Page;
import com.thinkgem.jeesite.common.service.CrudService;
import com.thinkgem.jeesite.modules.borrow.dao.BorrowLogDao;
import com.thinkgem.jeesite.modules.borrow.entity.BorrowCount;
import com.thinkgem.jeesite.modules.borrow.entity.BorrowCountByUserRoles;
import com.thinkgem.jeesite.modules.borrow.entity.BorrowLog;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 系统管理，安全相关实体的管理类,包括用户、角色、菜单.
 * @author ThinkGem
 * @version 2013-12-05
 */
@Service
@Transactional(readOnly = true)
public class BorrowLogService extends CrudService<BorrowLogDao, BorrowLog>{

	public Page<BorrowLog> findPage(Page<BorrowLog> page, BorrowLog borrowLog){
		borrowLog.setPage(page);
		page.setList(dao.findList(borrowLog));
		return page;
	}

	/**
	 * @param borrowCount
	 * @return
	 */
	public BorrowCount findCurrentCount(BorrowCount borrowCount){
		return dao.findCurrentCount(borrowCount);
	}

	public BorrowCount findReaderNum(BorrowCount borrowCount) {
		return dao.findReaderNum(borrowCount);
	}

	public List<BorrowCountByUserRoles> findBorrowCountByUserRoles(BorrowCountByUserRoles borrowCountByUserRoles){
		return dao.findBorrowCountByUserRoles(borrowCountByUserRoles);
	}
}
